
<%@ page language="java" isELIgnored="false"
	contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="ie=7" http-equiv="x-ua-compatible" />
<link href="<%=path%>/other/css/loginStyle.css" rel="stylesheet"
	type="text/css" />

<link href="<%=path%>/css/common.css" rel="stylesheet"/>
<link href="<%=path%>/css/select2.css" rel="stylesheet"/>
<script language="JavaScript">
	function checkform() {
		if (form_reg.username.value == "") {
			alert('请输入用户名!');
			form_reg.username.focus();
			return false;
		}
		if (form_reg.password.value == "") {
			alert('请输入密码!');
			form_reg.password.focus();
			return false;
		}
		if (form_reg.email.value == "") {
			alert('请填写你注册的邮箱!');
			form_reg.email.focus();
			return false;
		}
		if (form_reg.tel.value == "") {
			alert('请填写你的联系电话!');
			form_reg.tel.focus();
			return false;
		}
		return true;
	}
	/* $('#register').click(function(){
		var birthPlace=$('#loc_province').select2('data').text + ' - ' + $('#loc_city').select2('data').text + ' - ' +  $('#loc_town').select2('data').text;
		alert(birthPlace);
		
		
	}) */
</script>
<title>人才测评网站</title>
</head>

<body>
	<div>
		<div class="topbanner">
			<div class="float_l" style="width: 670px;">
				<a href="index.php"><img src="<%=path%>/images/login/logo.png"></a>
			</div>
		</div>
		<div class="clear"></div>
		<div class="top_logo">
			<div class="top_tit">
				<span class="float_l"><img
					src="<%=path%>/images/login/number.jpg"></span> <span
					class="float_r" style="padding-top: 10px;"><a
					href="index.php" style="color: #fff; font-weight: bold;">返回首页</a></span>
			</div>
		</div>
		<div class="login_main">
			<div style="padding-left: 30px; height: 40px; margin-top: 30px;">
				<div class="float_l nowlog_tag">
					<a href="reg.jsp" style="color: #fff;">会员注册</a>
				</div>
				<div class="float_l oldlog_tag">
					<a href="login.jsp">会员登录</a>
				</div>
			</div>
			<div class="clear"></div>
			<div class="reg_div">
				<table width="700" border="0" cellpadding="0" cellspacing="0">
					<form name="form_reg" action="<%=basePath %>/UserController/register.action" method="post"
					enctype="multipart/form-data"
						onsubmit="return checkform();">
					<tr><td></td><td ><div id="reg"></div></dic></td></tr>	
						<tr>
							<td width="110" class="reg">用户名：</td>
							<td width="316"><input type="text" id="userName"
								name="userName" class="reg_input" style="width: 300px;"
								 onchange="tocheckname()" /></td>
							<td width="274"><span class="red">*</span> <span
								id="UserName_Txt">建议使用常用邮箱作为用户名</span></td>
						</tr>
						<tr>
							<td class="reg">密 码：</td>
							<td><input type="password" id="userPassword"
								name="userPassword" class="reg_input" style="width: 300px;"
								onBlur="check_password();" /></td>
							<td><span class="red">*</span> <span id="UserPass">8-18个字符，最好有数字、字母、下划线组成</span></td>
						</tr>
						<tr>
							<td class="reg">性 别：</td>
							<td><input type="radio" name="userSex" id="userSex"
								value="男" checked />男 <input type="radio" name="userSex"
								value="女" />女</td>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td class="reg">姓名：</td>
							<td><input type="text" id="userRealname" name="userRealname"
								class="reg_input" style="width: 300px;" /></td>
							<td><span class="red">*</span></td>
						</tr>
						<tr>
							<td class="reg">电子邮箱：</td>
							<td><input type="email" id="userEmail" name="userEmail"
								class="reg_input" style="width: 300px;" /></td>
							<td><span class="red">*</span></td>
						</tr>
					<tr>
						<td class="reg">手 机：</td>
						<td><input type="text" id="userPhone" name="userPhone"
							class="reg_input" style="width: 300px;" /></td>
						<td><span class="red">*</span></td>
					</tr>
					<tr>
						<td class="reg">联系地址：</td>
						<td><input type="text" id="userAddress" name="userAddress"
							class="reg_input" style="width: 300px;" /></td>
						<td></td>
					</tr>
                    <input id="userNativeplace" name="userNativeplace" type="hidden"></input>
					<tr>
						<td class="reg">所在地区：</td>
						<td><select id="loc_province" style="width:140px;">
                           </select>
						  <select id="loc_city" style="width:150px; margin-left: 10px">
						  </select>
						</td>
						<td>  <select id="loc_town" style="width:140px;margin-left: 10px">
						  </select></td>
					</tr>
					 <!--  <input type="button" id="btntext" value="获取文本" style="padding:5px 15px;" /> -->
					<tr>

						<td class="reg">学 历：</td>
						<td><input type="text" id="userEducation"
							name="userEducation"  class="reg_input"
							style="width: 300px;"></input></td>
					</tr>
					<tr>
						<td class="reg">职业：</td>
						<td><input type="text" id="userPosition" name="userPosition"
							class="reg_input" style="width: 300px;" /></td>
						<td></td>
					</tr>
					<td class="reg">毕业院系：</td>
					<td><input type="text" id="userSchool" name="userSchool"
						class="reg_input" style="width: 300px;" placeholder="院系" /></td>
					<td><input type="text" id="userDepartment"
						name="userDepartment" class="reg_input" style="width: 300px;"
						placeholder="专业" /></td>
					<td><span class="red">*</span></td>
					</tr>
					<tr>
                    <tr>
						<td class="reg">头像：</td>
						<td>
						<input type="file" id="userImage" 
							name="photofile"
							class="reg_input" style="width: 300px;" />
						</td>
						<td></td>
						
						
					</tr>
						<td colspan="2" align="center"><input type="image" id="register"
							src="<%=path%>/images/login/regnow.jpg" class="reg_sub" /></td>
						<td></td>
					</tr>
					</form>
				</table>
			</div>
		</div>
		<div style="clear: both;"></div>
		<div class="bottom">
			<div class="bottodiv"
				style="margin: auto; font-family: Arial; text-align: center; position: relative;">
				电话：0571-88273037 &nbsp; 传真：0571-88273037 &nbsp; 电子邮箱：zjsrcfz@163.com
				&nbsp; 地址：中北大学教学主楼<br />
				
			</div>
			<div
				style="position: absolute; right: 20px; top: -20px; width: 100px; height: 100px;">
				<img src="images/erwm.jpg" width="100" /><br> 人才院官方微信号 
			</div>
		</div>
	</div>
	
	<script language="JavaScript">
	function tocheckname() 
	{ 
	var userName= $("#userName").val(); 
	$.ajax({ 
	type:"POST", 
	cache:false, 
	url : "../UserController/JudgeUser.action", 
	dataType : "text", 
	data:{"userName":$("#userName").val()}, 
	async:false, 
	success : function(data){ 
		
		var obj = JSON.parse(data);
		if(obj.error_code==500){
		
			$("#reg").html("<span id='f'><font fontsize='5' color='red'>"+"该用户名已存在"+"</font></span>");
	
		}
		else if(obj.error_code==200){

			$("#reg").html("<span id='f'><font fontsize='5' color='red'>"+"有效的用户名"+"</font></span>");
		}
	} 
	}); 
	} 
		function checkform() {

			if (form_reg.userName.value == "") {
				alert('请输入用户姓名/用户名!');
				form_reg.userName.focus();
				return false;
			}
			if (form_reg.userPassword.value == "") {
				alert('请输入密码!');
				form_reg.userPassword.focus();
				return false;
			}
	
			if (form_reg.userRealname.value == "") {
				alert('请输入姓名!');
				form_reg.userRealname.focus();
				return false;
			}
			if (form_reg.userEmail.value == "") {
				alert('请输入邮箱!');
				form_reg.userEmail.focus();
				return false;
			}
			if (form_reg.userPhone.value == "") {
				alert('请输入联系电话!');
				form_reg.userPhone.focus();
				return false;
			}
			if (form_reg.userSchool.value == "") {
				alert('请输入毕业学校!');
				form_reg.userSchool.focus();
				return false;
			}
			if (form_reg.userDepartment.value == "") {
				alert('请输入毕业院系!');
				form_reg.userDepartment.focus();
				return false;
			}
			
			return true;
		}
	</script>
<script src="<%=path%>/script/jquery-1.11.2.min.js"></script>
<script src="<%=path%>/js/selectarea.js"></script>
<script type="text/javascript" src="<%=path%>/js/area.js"></script>
<script type="text/javascript" src="<%=path%>/js/location.js"></script>
<script src="<%=path%>/js/select2.js"></script>
<script src="<%=path%>/js/select2_locale_zh-CN.js"></script>
</body>
</html>